﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Opennav.MapGenerator.OSM
{
    public abstract class OSMElement : OSMEntity
    {
        public uint Id { get; set; }

        public IList<OSMTag> Tags { get; set; }

        public bool ContainsTagKey(string key)
        {
            if (Tags == null)
                return false;
            foreach (OSMTag tag in Tags)
            {
                if (tag.Key == key)
                    return true;
            }
            return false;
        }

        public string GetTagValue(string key)
        {
            if (Tags == null)
                return null;
            foreach (OSMTag tag in Tags)
            {
                if (tag.Key == key)
                    return tag.Value;
            }
            return null;
        }
    }
}
